package com.hl.controller;

import com.hl.domain.Interpersonalcommunication;
import com.hl.service.InterpersonalcommunicationService;
import com.hl.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author: WenYong
 * @Date: 2024/9/4 19:26
 * @Version: 1.0
 */
//智慧生活栏目下的内容
@RestController
@RequestMapping("/fm/IntelligentLifeController")
public class IntelligentLifeController {
    @Autowired
    private InterpersonalcommunicationService interpersonalcommunicationService;

//    返回人际沟通所有的课程
    @GetMapping("/communication")
    public R findAll(int page,int pageSize,int index,boolean status){
        List<Interpersonalcommunication> allInterpersonalcommunication = interpersonalcommunicationService.getAllInterpersonalcommunication(page, pageSize, index,status);
        if (allInterpersonalcommunication.isEmpty()) {
            return R.fail("暂无内容");
        }else {
            return R.success(allInterpersonalcommunication);
        }
    }
}
